package dex.compiler.model.program;

import dex.compiler.model.definition.Definition;
import dex.compiler.model.definition.Unit;


/**
 * Criteria for a definition search.
 */
public interface Searcher {


	/**
	 * Returns the name of a particular unit to search in.  Or, null if all the
	 * imported units should be searched.
	 * 
	 * @return  the name of a particular unit to search
	 */
	String getQualifiedUnit();
	

	/**
	 * Returns true if the given definition matches the criteria.
	 * 
	 * @param unit  the unit that owns the definition 
	 * @param d     the definition to check
	 * @return   true if the definition matches the criteria
	 */
	boolean matches(Unit unit, Definition d);
	
	
}
